<?php 
namespace app\admin\model;
use think\Model;
use think\Db;
class GoodsSpec extends Model
{
	protected $table = 'spec';
	// 关联type数据
    public function getGoodsType()
    {
        // 用户HAS ONE档案关联
        return $this->hasOne('GoodsType','id','type_id');
    }
    public function getSpecItem($id=''){
    	return Db::table($this->table)->where('type_id',$id)->select();
    }
}